package com.ws.universal.tools.wsui.headle;

import android.content.res.ColorStateList;
import android.view.View;

import androidx.core.view.TintableBackgroundView;

import com.ws.universal.tools.wsui.help.QMUISkinHelper;

import org.jetbrains.annotations.NotNull;

public class QMUISkinRuleBgTintColorHandler extends QMUISkinRuleColorStateListHandler {
    @Override
    protected void handle(@NotNull View view, @NotNull String name, ColorStateList colorStateList) {
        if (view instanceof TintableBackgroundView) {
            ((TintableBackgroundView) view).setSupportBackgroundTintList(colorStateList);
        } else {
            QMUISkinHelper.warnRuleNotSupport(view, name);
        }
    }
}
